<?php // no direct access
/**
 * @review is this used? it looks like that module for
 * the query form? and wants this validateForm function?
 * looks like a client-side form validator?
 */
 
defined('_JEXEC') or die('Restricted access'); ?>
<script type="text/javascript">
<!--
	function validateForm( frm ) {
		var valid = document.formvalidator.isValid(frm);
		if (valid == false) {
			// do field validation
			if (frm.email.invalid) {
				alert( "<?php echo JText::_( 'Please enter a valid e-mail address.', true );?>" );
			} else if (frm.text.invalid) {
				alert( "<?php echo JText::_( 'CONTACT_FORM_NC', true ); ?>" );
			}
			return false;
		} else {
			frm.submit();
		}
	}
// -->
</script>
<?php if(isset($this->error)) : ?>
<div>
	<p><?php echo $this->error; ?></p>
</div>
<?php endif; ?>
<div style="width:400px;">
	<form action="<?php echo JRoute::_('index.php') ?>" method="post" name="queryForm" target="_top" id="bookstore_queryForm" class="form-bookstore_query">
		<div class="query">
			<label for="query_box">
				&nbsp;<?php echo JText::_( 'Search' );?>:
			</label>
		</div>
		<div><input type="text" name="terms" id="query_box" size="30" class="inputbox" value="" /></div>
		<br />
		<div><button class="button validate" type="submit"><?php echo JText::_('Submit'); ?></button></div>
		
	<div>
	<input type="hidden" name="option" value="com_bookstore" />
    <input type="hidden" name="view" value="bookstore" />
	</div>
	</form>
</div>